//
//  ZJAddAdressView.m
//  ZiJinLian
//
//  Created by lc on 2017/3/20.
//  Copyright © 2017年 lzy. All rights reserved.
//

#import "ZJAddAddressView.h"
#import "ZJCommItem.h"
@implementation ZJAddAddressView

-(instancetype)initWithFrame:(CGRect)frame{    
    if (self==[super initWithFrame:frame]) {
        [self addSubview:self.peopleItem];
         [self.peopleItem mas_makeConstraints:^(MASConstraintMaker *make) {
             make.top.equalTo(self.mas_top);
             make.left.equalTo(self.mas_left);
             make.height.mas_equalTo(50);
             make.width.equalTo(self.mas_width);
         }];
        [self addSubview:self.phoneItem];
        self.phoneItem.textField.keyboardType=UIKeyboardTypeNumberPad;
        [self.phoneItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.peopleItem.mas_bottom);
            make.left.equalTo(self.mas_left);
            make.height.mas_equalTo(50);
            make.width.equalTo(self.mas_width);
        }];
        [self addSubview:self.aearItem];
        [self.aearItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.phoneItem.mas_bottom);
            make.left.equalTo(self.mas_left);
            make.height.mas_equalTo(50);
            make.width.equalTo(self.mas_width);
        }];
        [self addSubview:self.addressDetailItem];
        [self.addressDetailItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.aearItem.mas_bottom);
            make.left.equalTo(self.mas_left);
            make.height.mas_equalTo(50);
            make.width.equalTo(self.mas_width);
        }];
        [self addSubview:self.setDefaultItem];
        
        
        [self.setDefaultItem mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.addressDetailItem.mas_bottom).offset(10);
            make.left.equalTo(self.mas_left);
            make.height.mas_equalTo(50);
            make.width.equalTo(self.mas_width);
        }];
    }
    return self;
}





-(ZJCommItem *)peopleItem{
    if (!_peopleItem) {
        _peopleItem=[[ZJCommItem alloc]init];
        [_peopleItem withTypeItemType:ZJCOMM title:@"收货人"];
    }
    return  _peopleItem;
}
-(ZJCommItem *)phoneItem{
    if (!_phoneItem) {
        _phoneItem=[[ZJCommItem alloc]init];
        [_phoneItem withTypeItemType:ZJCOMM title:@"联系电话"];
        
    }
    return _phoneItem;
}
-(ZJCommItem *)aearItem{
    if (!_aearItem) {
        _aearItem=[[ZJCommItem alloc]init];
        [_aearItem withTypeItemType:ZJARROW_TEXT title:@"所在地区"];
    }
    return _aearItem;
}


-(ZJCommItem *)addressDetailItem{
    if (!_addressDetailItem) {
        _addressDetailItem=[[ZJCommItem alloc]init];
        [_addressDetailItem withTypeItemType:ZJONLYTXT title:@"请填写详细地址"];
    }
    return _addressDetailItem;
}

-(ZJCommItem *)setDefaultItem{
    if (!_setDefaultItem) {
        _setDefaultItem=[[ZJCommItem alloc]init];
        [_setDefaultItem withTypeItemType:ZJCHECK title:@"设为默认"];
    }
    return _setDefaultItem;
}




@end

